package com.didier.orga.model;

import java.io.FileWriter;
import java.io.IOException;

import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONStringer;

public class JsonDummy {
	public String jsonDecode(String sc){
		if (sc.equals("") == true)
			return "{\"Orgas\":[{\"Nom\":\"Orga\",\"Modules\":[{\"Nom\":\"modulex\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[\"srv1\"]},{\"Nom\":\"z2\",\"VMs\":[]},{\"Nom\":\"z3\",\"VMs\":[]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]}]},{\"Nom\":\"Orgaa\",\"Modules\":[{\"Nom\":\"modulo\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]},{\"Nom\":\"modulo\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]} ]}]}";
		else
			if (sc.equals("Orga") == true)
				return "{\"Orgas\":[{\"Nom\":\"Orgaam\",\"Modules\":[{\"Nom\":\"modulo\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[\"srv1\",\"srv2\"]},{\"Nom\":\"a2\",\"VMs\":[\"srv1\"]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]},{\"Nom\":\"modulox\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]},{\"Nom\":\"moduled\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]}]}]}";
			else
				if (sc.equals("Didier") == true)
					return "{\"Orgas\":[{\"Nom\":\"Orga\",\"Modules\":[{\"Nom\":\"modulex\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[\"srv1\"]},{\"Nom\":\"z2\",\"VMs\":[]},{\"Nom\":\"z3\",\"VMs\":[]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]}]},{\"Nom\":\"Orgaa\",\"Modules\":[{\"Nom\":\"modulo\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]},{\"Nom\":\"modulo\",\"Archis\":[{\"Nom\":\"archit\",\"Zones\":[{\"Nom\":\"a1\",\"VMs\":[]},{\"Nom\":\"a2\",\"VMs\":[]},{\"Nom\":\"a3\",\"VMs\":[]}]},{\"Nom\":\"add\",\"Zones\":[{\"Nom\":\"sa\",\"VMs\":[]},{\"Nom\":\"sb\",\"VMs\":[]},{\"Nom\":\"sc\",\"VMs\":[]}]}]} ]}]}";
				else
					if (sc.equals("VM") == true)
						return "{\"VM\":[{\"Nom\":\"VMDEB2\",\"Ip\":\"10.134.220.113\",\"Cpu\":\"2\",\"Template\":\"Debian\",\"Type\":\"bronze\",\"Ram\":\"8\",\"Disque\":\"50\"}]}";

		return "{\"Orgas\":[{\"Nom\":\"Orga\",\"Modules\":["
				+ "{\"Nom\":\"modulix\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z2\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z3\",\"VMs\":[\"srv5\",\"srv5\"]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]},"
				+ "{\"Nom\":\"modulix\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z2\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z3\",\"VMs\":[\"srv5\",\"srv5\"]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]},"
				+ "{\"Nom\":\"modulix\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[]},{\"Nom\":\"z2\",\"VMs\":[]},{\"Nom\":\"z3\",\"VMs\":[\"srv5\",\"srv5\"]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]},"
				+ "{\"Nom\":\"modulix\",\"Archis\":[{\"Nom\":\"Archi\",\"Zones\":[{\"Nom\":\"z1\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z2\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]},{\"Nom\":\"z3\",\"VMs\":[\"srv5\",\"srv5\"]}]},{\"Nom\":\"zrchi\",\"Zones\":[{\"Nom\":\"ze1\",\"VMs\":[]},{\"Nom\":\"ze2\",\"VMs\":[]},{\"Nom\":\"ze3\",\"VMs\":[\"srv1\",\"srv2\",\"srv3\",\"srv4\",\"srv5\"]}]},{\"Nom\":\"looky\",\"Zones\":[{\"Nom\":\"jimmy\",\"VMs\":[]},{\"Nom\":\"loklk\",\"VMs\":[]},{\"Nom\":\"iuyf\",\"VMs\":[]}]}]}"
				+ "]} ]}";





	}

	public String jsonFw(){
		return "{\"Firewall\":[{\"Source\":\"10.10.0.0/24\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
				+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::FRONT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
				+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::FRONT\"},"
				+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::REMOTE-AGENT\"},"
				+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Any\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::FRONT-WEB\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::DATABASES\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::DATABASES\"},"
				+ "{\"Source\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::FRONT-WEB\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\"},"
				+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::REMOTE-AGENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
				+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\"}]"
				+ "  , \"Utilisateur\":[{\"Nom\":\"Machin\",\"Prenom\":\"Alfred\",\"Login\":\"log\"}]}";
		
	/*	 return "{{\"Firewall\":[{\"Source\":\"10.10.0.0/24\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
		+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::FRONT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
		+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::FRONT\"},"
		+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::REMOTE-AGENT\"},"
		+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Any\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::FRONT-WEB\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::DATABASES\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::DATABASES\"},"
		+ "{\"Source\":\"Orsyp::WEB-ARCHITECTURE::INTRANET::FRONT-WEB\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"IP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\"},"
		+ "{\"Source\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::REMOTE-AGENT\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Any\"},"
		+ "{\"Source\":\"Any\",\"Port\":null,\"Action\":\"Acc.\",\"Type\":\"TCP\",\"Destination\":\"Orsyp::PERFORMANCE-AND-CAPACITY::SYSLOAD::MANAGEMENT\"}]"
		+ " }, {\"Utilisateur\":\" nom\" }}";
					
	*/
	}
	
	
}
	  